package com.hanxy.admin.controller;

import com.hanxy.admin.model.req.SysDepartmentReq;
import com.hanxy.admin.service.*;
import com.hxy.base.constant.BaseSysConf;
import com.hxy.base.utils.ResultUtil;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private ISysUserService userService;

    @Autowired
    private ISysUserRoleService userRoleService;

    @Autowired
    private ISysRoleService roleService;

    @Autowired
    private ISysRoleMenuService roleMenuService;

    @Autowired
    private ISysMenuService menuService;

    @Autowired
    private ISysDepartmentService departmentService;

    @ApiOperation(value = "获取部门列表分页", notes = "获取部门列表分页", response = String.class)
    @PostMapping(value = "/department/getPageList")
    public String getPageList( @RequestBody SysDepartmentReq req) {
        return ResultUtil.result(BaseSysConf.SUCCESS, departmentService.getPageList(req));
    }

    @ApiOperation(value = "获取部门列表", notes = "获取部门列表", response = String.class)
    @PostMapping(value = "/department/getList")
    public String getList( @RequestBody SysDepartmentReq req) {
        return ResultUtil.result(BaseSysConf.SUCCESS, departmentService.getList(req));
    }

}
